﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChholCmdPort {
	public class ChholRegisterFlag: IDisposable{
		uint hash;
		Action<ChholCmdPort.Pkg> action;
		ChholRegister recv_register;

		public ChholRegisterFlag( ChholRegister recv_register, uint hash, Action<ChholCmdPort.Pkg> action) {
			this.recv_register = recv_register;
			this.action = action;
			this.hash = hash;
			recv_register.registRecvAction(hash, action);
		}

		public void Dispose() {
			recv_register.unregistRecvAction(hash, action);
		}
	}
}
